myApp.controller('inspectionTemplateAdd', function ($rootScope, $scope, $http, $uibModalInstance, httpService, formBoxData) {
	
	/*关闭的图片*/
	$scope.closeImg={'img':'images/close-default.png','defaultImg':'images/close-default.png','downImg':'images/close-btndown.png','hoverImg':'images/close-hover.png'};
    $scope.title = formBoxData.title;
    $scope.formData = {};


    $scope.headTitle=[
        {
            name:'巡检项目',
            filed:'sysName',
            width:'25%'
        },
        {
            name:'巡检内容',
            filed:'content',
            width:'20%'
        },
        {
            name:'巡检类型',
            filed:'resultTypeLocal',
            width:'25%'
        },
        {
            name:'备注',
            filed:'remark',
            width:'20%'
        }

    ];

    $rootScope.selectList=[];
    $scope.$on('selectTemplateContent',function (event,data) {
        $rootScope.selectList=$scope.selectList.concat(data.list);
        console.log(data);
        $rootScope.selectList.map(function(item,index){
            item['checked']=false;
            return item;
        });
    });

    // 保存
    $scope.ok = function () {
        $uibModalInstance.close();
    };
    // 取消
    $scope.cancel = function () {
        $uibModalInstance.dismiss('cancel');
    };
});
